<%@ page language="java" pageEncoding="utf-8"%>

<%@ page isELIgnored="false" %>

<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%> 
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html"%>
 
 
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
 
<html> 
	<head>
	
		<title>JSP for ActivityForm form</title>
		
		<script src="dwr/interface/ActivityTypeService.js"></script>
		<script src="dwr/engine.js"></script> 
		<script src="dwr/util.js"></script>
		
		<script type="text/javascript">
		function getAllBigType(){
			ActivityTypeService.findAllBigType(addOption);
		}
		
		function addOption(data){
			DWRUtil.removeAllOptions("select");
			
			DWRUtil.addOptions("select", data, "bigtypeId", "bigtypeName");
		}
	
		function getSmallType(){
			ActivityTypeService.findByBigType(DWRUtil.getValue("bigType"),addSmallyType);
		}
	
		function addSmallyType(data) {
			
			DWRUtil.removeAllOptions("smallType");
			DWRUtil.addOptions("smallType", data, "smalltypeId", "smalltypeName");
		}
		</script>
		
	</head>
	<body>
		<html:form action="/activity.do?method=post">
			bigType : <html:select styleId="bigType" property="bigType" onchange="getSmallType()">
						<c:forEach items="${requestScope.list}" var="data">
						<html:option value="${data.bigtypeId}">${data.bigtypeName}</html:option>
						</c:forEach>
					</html:select><html:errors property="bigType"/><br/>
			smallType : <html:select styleId="smallType" property="smallType">
						<html:option value="">请选择小分类</html:option>
						
						</html:select><html:errors property="smallType"/><br/>
			contact : <html:text property="contact"/><html:errors property="contact"/><br/>
			address : <html:text property="address"/><html:errors property="address"/><br/>
			title : <html:text property="title"/><html:errors property="title"/><br/>
			deadTime : <html:text property="deadTime"/><html:errors property="deadTime"/><br/>
			content : <html:textarea property="content"/><html:errors property="content"/><br/>
			startTime : <html:text property="startTime"/><html:errors property="startTime"/><br/>
			
			endTime : <html:text property="endTime"/><html:errors property="endTime"/><br/>
			<html:submit/><html:cancel/>
		</html:form>
	</body>
</html>

